﻿using System;
using FreeSql.DataAnnotations;

namespace Model
{
    public class UserInfo
    {
        [Column(IsIdentity = false, IsPrimary = true)]
        public string account { get; set; }
        public string password { get; set; }
        public string name { get; set; }
        public string sex { get; set; }
        public string address { get; set; }
        public string tel { get; set; }
        public string identity { get; set; }
        public bool isDel { get; set; }
        //默认构造函数
        public UserInfo() { }
        //所有参数
        public UserInfo(string account, string password, string name, string sex, string address, string tel, string identity, bool isDel)
        {
            this.account = account;
            this.password = password;
            this.name = name;
            this.sex = sex;
            this.address = address;
            this.tel = tel;
            this.identity = identity;
            this.isDel = isDel;
        }
        //登录传参
        public UserInfo(string account, string password) {
            this.account = account;
            this.password = password;
        }
        //注册传参
        public UserInfo(string account, string password, string sex)
        {
            this.account = account;
            this.password = password;
            this.sex = sex;
            this.identity = "用户";
        }
        //收货信息
        public UserInfo(string account, string name, string tel, string address)
        {
            this.account = account;
            this.name = name;
            this.tel = tel;
            this.address = address;
        }
    }
}
